import React from 'react';
import { Card, Descriptions, Button } from 'antd';

interface UserProfileProps {
  user: {
    name: string;
    email: string;
    phone: string;
    address: string;
  };
  onEdit: () => void;
}

const UserProfile: React.FC<UserProfileProps> = ({ user, onEdit }) => {
  return (
    <Card title="个人信息" extra={<Button onClick={onEdit}>编辑</Button>}>
      <Descriptions column={1}>
        <Descriptions.Item label="姓名">{user.name}</Descriptions.Item>
        <Descriptions.Item label="邮箱">{user.email}</Descriptions.Item>
        <Descriptions.Item label="电话">{user.phone}</Descriptions.Item>
        <Descriptions.Item label="地址">{user.address}</Descriptions.Item>
      </Descriptions>
    </Card>
  );
};

export default UserProfile;